package com.example.testproject.activity

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.example.testproject.R
import com.example.testproject.bean.BaseLiveDataBus
import com.example.testproject.bean.TestLiveData
import com.example.testproject.utils.toast
import kotlinx.android.synthetic.main.activity_b_viscosity.*

/**
 *
 * @ClassName: BViscosityTestActivity
 * @Author: android 超级兵
 * @CreateDate: 11/15/21$ 7:37 PM$
 * TODO
 */
class BViscosityTestActivity : AppCompatActivity() {


    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_b_viscosity)

        TestLiveData.textLiveData.observe(this) {
            "执行了${it}" toast this
            tvHead.text = "接收到数据:${it}"
        }

        BaseLiveDataBus.with<String>("test").observe(this){
            "执行了${it}" toast this
            tvHead.text = "接收到数据:${it}"
        }
    }
}